<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>练习</title>
    <script>
        //1.
        let arr1 = [1, 2, 3, 4, true, "1321", 60]
        let newArr1 = [];
        let n = 0;
        for (let i = 0; i < arr1.length; i++) {
            if (typeof arr1[i] === "number") {
                newArr1[n++] = arr1[i];
            }
        }
        console.log(newArr1);
        //2.
        let arr2 = ["10", "20", "30", "40"];
        let newArr2 = [];
        console.log(arr2);
        for (let i = 0; i < arr2.length; i++) {
            newArr2[i] = arr2[i] * 1;
        }
        console.log(newArr2);
        //3.是否有学生不及格   是否有不及格的学生
        let arr3 = [90, 56, 65, 67, 87, 67, 76, 34, 70];
        let arr4 = [90, 66, 65, 67, 87, 67, 76, 71, 70];
        function pass(arr) {
            let flag = false;
            for (let i = 0; i < arr.length; i++) {
                if (arr[i] < 60) {
                    flag=true;
                    break;
                } 
            }
            console.log(flag)
        }
        pass(arr3);
        pass(arr4);


    </script>
</head>

<body>

</body>

</html>